﻿

using System;
using Demo.ServiceContracts;
using Demo.Infrastructure;
using Demo.DataObjects;

namespace Demo.Services
{
    public class UserService :IUserService
    {
        private readonly IUserService UserServiceimpl = ServiceLocator.Instance.GetService<IUserService>();

        public UserDTO GetUserDTOWithName(string userName)
        {
            return UserServiceimpl.GetUserDTOWithName(userName);
        }

        public bool ExistsWithUserName(string userName)
        {
            return UserServiceimpl.ExistsWithUserName(userName);
        }

        public bool Exists(string userName, string password)
        {
            return UserServiceimpl.Exists(userName, password);
        }

        public void CreateUser(string userName, string password, int roleID)
        {
            UserServiceimpl.CreateUser(userName, password, roleID);
        }

        public bool ChangePassword(string userName, string password, string newPassword)
        {
            return UserServiceimpl.ChangePassword(userName, password, newPassword);
        }

        public bool ChangeRole(string userName, int roleID)
        {
            return UserServiceimpl.ChangeRole(userName, roleID);
        }
    }
}
